#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<vector>
using namespace std;
class Solution
{
public:
    bool cmp(string s)
    {
        return s >= "20" && s <= "26";
    }
    int numDecodings(string s)
    {
        int n = s.size();
        vector<int> dp(n + 2);
        dp[0] = dp[1] = 1;
        for (int i = 2;i < n + 2;i++)
        {
            if (s[i - 2] != '0') dp[i] += dp[i - 1];
            if (i - 3 >= 0 && cmp(s.substr(i - 3, 2))) dp[i] += dp[i - 2];
        }
        return dp[n + 1];
    }
};
int main()
{
    Solution().numDecodings("12");
	return 0;
}